<template>
  <div>
    <TypeNav/>
    <ListContainer/>
    <TodayRecommend/>
    <Rank/>
    <Like/>
    <Floor v-for="(floor) in floorList" :key="floor.id" :list="floor"/>
    <Brand/>
  </div>
</template>

<script>
import ListContainer from "../Home/ListContainer/index.vue";
import TodayRecommend from "../Home/TodayRecommend/index.vue";
import Rank from "../Home/Rank/index.vue";
import Like from "./Like/index.vue";
import Floor from "./Floor/index.vue";
import Brand from "./Brand/index.vue";
import {mapState} from 'vuex'

export default {
  name: "MyHome",
  components:{ListContainer,TodayRecommend,Rank,Like,Floor,Brand},
  mounted() {
    // 派发action获取floor组件的数据
    this.$store.dispatch("getFloorList")
  },
  computed: {
    ...mapState({
      floorList: state => state.home.floorList
    }),
  }
};
</script>